Skip to content

fix: keep the post title outside the editable writing flow root - #837

Merged
dcalhoun merged 1 commit into
trunkfrom
fix/post-title-outside-editable-root
Oct 27, 2026
Merged

dcalhoun merged 1 commit into
trunkfrom
fix/post-title-outside-editable-root

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What?

Keep the post title outside of the editable writing flow root.

Why?

It became near impossible to move the caret from the post title to a block. The caret erroneously moved back into the post title when attempting to move the caret to a block.

These changes partially address the problems presented in #821. They only address the post title. There are additional caret move issues referenced in WordPress/gutenberg#85483 (comment), therefore the previous patch disabling editableRoot is not yet removed.

How?

Add contentEditable={ false } to the post title component, matching core's post editor change in WordPress/gutenberg#38892.

Testing Instructions

  1. Open an existing post with content
  2. Move the caret into the post title
  3. Move the caret into a block in the post content (e.g., a paragraph)
  4. Verify the caret is rendered in the targeted block, and typing inserts text into the block instead of the post title

Accessibility Testing Instructions

Performing the testing instructions with a screen reader should also succeed.

Screenshots or screencast

See recording of the original issue in #821.


AI-generated details

Marks the post title wrapper contentEditable={ false }, matching core's post editor (added in WordPress/gutenberg#38892).

When the writing flow wrapper becomes an editing host (during a multi-selection, or whenever a block that opts into editableRoot is selected), a title without a non-editable wrapper becomes ordinary editable content inside that host instead of its own field. On iOS, taps then leave the caret stuck in the title while focus and block selection move elsewhere. This was GBK-specific: core's own title wrapper has the attribute, which is why the bug didn't reproduce in core.

#821 removed the Paragraph and List Item editableRoot opt-ins, so on trunk the wrapper only becomes editable during a multi-selection. This fix is needed before those opt-ins can return.

Testing: to reproduce on trunk, remove the editableRootKey hunks from patches/@wordpress+block-library+11.2.0.patch and reinstall dependencies. On iOS, select a paragraph, tap the post title, and type: the text should go into the title.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EB2aXCE1bcZisf7iy9zTLs

When the writing flow wrapper becomes an editing host, the title became
plain editable content inside it, leaving the iOS caret stuck in the
title. Core marks the title wrapper non-editable for the same reason
(gutenberg#38892).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EB2aXCE1bcZisf7iy9zTLs
@github-actions github-actions Bot added the [Type] Bug An existing feature does not function as intended label Oct 27, 2026
@wpmobilebot

Copy link
Copy Markdown

XCFramework Build

This PR's XCFramework is available for testing. Add the following to your Package.swift:

.package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/837")

Built from 6a37fc3

@dcalhoun
dcalhoun merged commit 463c01f into trunk Oct 27, 2026
32 checks passed
@dcalhoun
dcalhoun deleted the fix/post-title-outside-editable-root branch October 27, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants